Integrand size = 39, antiderivative size = 63 \[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\frac {a (i A+B) (c-i c \tan (e+f x))^n}{f n}-\frac {a B (c-i c \tan (e+f x))^{1+n}}{c f (1+n)} \]
Time = 1.00 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.79 \[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\frac {i a (c-i c \tan (e+f x))^n (A-i B+A n+B n \tan (e+f x))}{f n (1+n)} \]
Time = 0.31 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.02, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {3042, 4071, 53, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x))^ndx\) |
\(\Big \downarrow \) 4071 |
\(\displaystyle \frac {a c \int (A+B \tan (e+f x)) (c-i c \tan (e+f x))^{n-1}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 53 |
\(\displaystyle \frac {a c \int \left ((A-i B) (c-i c \tan (e+f x))^{n-1}+\frac {i B (c-i c \tan (e+f x))^n}{c}\right )d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {a c \left (\frac {(B+i A) (c-i c \tan (e+f x))^n}{c n}-\frac {B (c-i c \tan (e+f x))^{n+1}}{c^2 (n+1)}\right )}{f}\) |
(a*c*(((I*A + B)*(c - I*c*Tan[e + f*x])^n)/(c*n) - (B*(c - I*c*Tan[e + f*x ])^(1 + n))/(c^2*(1 + n))))/f
3.7.65.3.1 Defintions of rubi rules used
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int [ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0] && LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Si mp[a*(c/f) Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x], x , Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]
Time = 1.22 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.27
method | result | size |
derivativedivides | \(\frac {\left (i A a n +i A a +B a \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f n \left (1+n \right )}+\frac {i B a \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (1+n \right )}\) | \(80\) |
default | \(\frac {\left (i A a n +i A a +B a \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f n \left (1+n \right )}+\frac {i B a \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (1+n \right )}\) | \(80\) |
norman | \(\frac {\left (i A a n +i A a +B a \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f n \left (1+n \right )}+\frac {i B a \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (1+n \right )}\) | \(80\) |
risch | \(\text {Expression too large to display}\) | \(1058\) |
1/f/n/(1+n)*(I*A*a*n+I*A*a+B*a)*exp(n*ln(c-I*c*tan(f*x+e)))+I*B*a/f/(1+n)* tan(f*x+e)*exp(n*ln(c-I*c*tan(f*x+e)))
Time = 0.26 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.48 \[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\frac {{\left ({\left (i \, A - B\right )} a n + {\left (i \, A + B\right )} a + {\left ({\left (i \, A + B\right )} a n + {\left (i \, A + B\right )} a\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \left (\frac {2 \, c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n}}{f n^{2} + f n + {\left (f n^{2} + f n\right )} e^{\left (2 i \, f x + 2 i \, e\right )}} \]
((I*A - B)*a*n + (I*A + B)*a + ((I*A + B)*a*n + (I*A + B)*a)*e^(2*I*f*x + 2*I*e))*(2*c/(e^(2*I*f*x + 2*I*e) + 1))^n/(f*n^2 + f*n + (f*n^2 + f*n)*e^( 2*I*f*x + 2*I*e))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 394 vs. \(2 (48) = 96\).
Time = 0.57 (sec) , antiderivative size = 394, normalized size of antiderivative = 6.25 \[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\begin {cases} x \left (A + B \tan {\left (e \right )}\right ) \left (i a \tan {\left (e \right )} + a\right ) \left (- i c \tan {\left (e \right )} + c\right )^{n} & \text {for}\: f = 0 \\\frac {2 A a}{2 c f \tan {\left (e + f x \right )} + 2 i c f} + \frac {2 i B a f x \tan {\left (e + f x \right )}}{2 c f \tan {\left (e + f x \right )} + 2 i c f} - \frac {2 B a f x}{2 c f \tan {\left (e + f x \right )} + 2 i c f} - \frac {B a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan {\left (e + f x \right )}}{2 c f \tan {\left (e + f x \right )} + 2 i c f} - \frac {i B a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 c f \tan {\left (e + f x \right )} + 2 i c f} - \frac {2 i B a}{2 c f \tan {\left (e + f x \right )} + 2 i c f} & \text {for}\: n = -1 \\A a x + \frac {i A a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - i B a x + \frac {B a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {i B a \tan {\left (e + f x \right )}}{f} & \text {for}\: n = 0 \\\frac {i A a n \left (- i c \tan {\left (e + f x \right )} + c\right )^{n}}{f n^{2} + f n} + \frac {i A a \left (- i c \tan {\left (e + f x \right )} + c\right )^{n}}{f n^{2} + f n} + \frac {i B a n \left (- i c \tan {\left (e + f x \right )} + c\right )^{n} \tan {\left (e + f x \right )}}{f n^{2} + f n} + \frac {B a \left (- i c \tan {\left (e + f x \right )} + c\right )^{n}}{f n^{2} + f n} & \text {otherwise} \end {cases} \]
Piecewise((x*(A + B*tan(e))*(I*a*tan(e) + a)*(-I*c*tan(e) + c)**n, Eq(f, 0 )), (2*A*a/(2*c*f*tan(e + f*x) + 2*I*c*f) + 2*I*B*a*f*x*tan(e + f*x)/(2*c* f*tan(e + f*x) + 2*I*c*f) - 2*B*a*f*x/(2*c*f*tan(e + f*x) + 2*I*c*f) - B*a *log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*c*f*tan(e + f*x) + 2*I*c*f) - I* B*a*log(tan(e + f*x)**2 + 1)/(2*c*f*tan(e + f*x) + 2*I*c*f) - 2*I*B*a/(2*c *f*tan(e + f*x) + 2*I*c*f), Eq(n, -1)), (A*a*x + I*A*a*log(tan(e + f*x)**2 + 1)/(2*f) - I*B*a*x + B*a*log(tan(e + f*x)**2 + 1)/(2*f) + I*B*a*tan(e + f*x)/f, Eq(n, 0)), (I*A*a*n*(-I*c*tan(e + f*x) + c)**n/(f*n**2 + f*n) + I *A*a*(-I*c*tan(e + f*x) + c)**n/(f*n**2 + f*n) + I*B*a*n*(-I*c*tan(e + f*x ) + c)**n*tan(e + f*x)/(f*n**2 + f*n) + B*a*(-I*c*tan(e + f*x) + c)**n/(f* n**2 + f*n), True))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 311 vs. \(2 (57) = 114\).
Time = 0.45 (sec) , antiderivative size = 311, normalized size of antiderivative = 4.94 \[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\frac {{\left ({\left (A - i \, B\right )} a c^{n} n + {\left (A - i \, B\right )} a c^{n}\right )} 2^{n} \cos \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right ) + {\left ({\left (A + i \, B\right )} a c^{n} n + {\left (A - i \, B\right )} a c^{n}\right )} 2^{n} \cos \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) - {\left ({\left (i \, A + B\right )} a c^{n} n + {\left (i \, A + B\right )} a c^{n}\right )} 2^{n} \sin \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right ) - {\left ({\left (i \, A - B\right )} a c^{n} n + {\left (i \, A + B\right )} a c^{n}\right )} 2^{n} \sin \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right )}{{\left (-i \, n^{2} + {\left (-i \, n^{2} - i \, n\right )} \cos \left (2 \, f x + 2 \, e\right ) + {\left (n^{2} + n\right )} \sin \left (2 \, f x + 2 \, e\right ) - i \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n} f} \]
(((A - I*B)*a*c^n*n + (A - I*B)*a*c^n)*2^n*cos(-2*f*x + n*arctan2(sin(2*f* x + 2*e), cos(2*f*x + 2*e) + 1) - 2*e) + ((A + I*B)*a*c^n*n + (A - I*B)*a* c^n)*2^n*cos(n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) - ((I*A + B)*a*c^n*n + (I*A + B)*a*c^n)*2^n*sin(-2*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 2*e) - ((I*A - B)*a*c^n*n + (I*A + B)*a*c^n)*2^n* sin(n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)))/((-I*n^2 + (-I*n^2 - I*n)*cos(2*f*x + 2*e) + (n^2 + n)*sin(2*f*x + 2*e) - I*n)*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*f)
\[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=\int { {\left (B \tan \left (f x + e\right ) + A\right )} {\left (i \, a \tan \left (f x + e\right ) + a\right )} {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n} \,d x } \]
Time = 1.20 (sec) , antiderivative size = 128, normalized size of antiderivative = 2.03 \[ \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx=-\frac {\left (\cos \left (e+f\,x\right )-\sin \left (e+f\,x\right )\,1{}\mathrm {i}\right )\,{\left (c-\frac {c\,\sin \left (e+f\,x\right )\,1{}\mathrm {i}}{\cos \left (e+f\,x\right )}\right )}^n\,\left (\frac {a\,\left (A-B\,1{}\mathrm {i}+A\,n+B\,n\,1{}\mathrm {i}\right )}{f\,n\,\left (n\,1{}\mathrm {i}+1{}\mathrm {i}\right )}+\frac {a\,\left (A-B\,1{}\mathrm {i}\right )\,\left (\cos \left (2\,e+2\,f\,x\right )+\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )\,\left (n+1\right )}{f\,n\,\left (n\,1{}\mathrm {i}+1{}\mathrm {i}\right )}\right )}{2\,\cos \left (e+f\,x\right )} \]